﻿using System;
using System.Data.SqlTypes;
using sqlserverextensions.Helper;


    public partial class UserDefinedFunctions
    {
        [Microsoft.SqlServer.Server.SqlFunction]
        public static SqlBoolean FileExists(SqlString path)
        {
            Int16 errSeverity = 16;

            try
            {
                return System.IO.File.Exists(path.Value);

            }
            catch (Exception ex)
            {
                ExceptionHelper.EvaluateException(ex, errSeverity);
                return false;
            }
        }
    }


